-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add access methods to get the Wire bus number and I2C bus handle #11570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hello me-no-dev, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 10s ⏱️ Results for commit 6300908. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
This pull request introduces enhancements to the ESP32 I2C handling by adding new utility functions and improving the
TwoWire
class. The changes include adding a method to retrieve the I2C bus number, introducing a function to get the bus handle, and ensuring compatibility with specific ESP-IDF versions.Enhancements to I2C Utilities:
i2cBusHandle(uint8_t i2c_num)
inesp32-hal-i2c-ng.c
to retrieve the bus handle for a given I2C bus number, returningNULL
if the number is invalid.i2cBusHandle(uint8_t i2c_num)
inesp32-hal-i2c.h
and gated it behind a version check for ESP-IDF 5.4.0 or higher.esp_idf_version.h
header inesp32-hal-i2c.h
to enable version-based conditional compilation.Improvements to
TwoWire
Class:TwoWire
constructor inWire.cpp
to remove the bitwise operation on the bus number, ensuring the full bus number is stored.getBusNum()
toTwoWire
inWire.cpp
and declared it inWire.h
, allowing retrieval of the I2C bus number. [1] [2]